package com.gasolinator.a.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by IntelliJ IDEA.
 * User: fjhidalgo
 * Date: 12/12/11
 * Time: 8:37
 * To change this template use File | Settings | File Templates.
 */
public class ApplicationData {

    private static final String  sourceVersion="application.sources.version";
    private static final String  MajorMinorVersion="1.0";

    public String getSourceVersion() {
        String version = MajorMinorVersion + "." + getVersionProperty(sourceVersion);
        return version;
	}
    public static String getVersionProperty(String propertyName)
    {
        Properties prop = new Properties();

        try {
            InputStream properties = ApplicationData.class.getResourceAsStream("/version.properties");
            prop.load(properties);
        }
        catch (IOException e)
        {
            System.out.println("retrieveTestKey::Unable to load properties from getVersionProperty");
        }
        return prop.getProperty(propertyName);
    }
}
